/*
 * Copyright 2014 Will Dignazio
 */
#include <pthread.h>
#include <stdio.h>
#include "../include/socketio.h"

int
main(int argc, char *argv[])
{
	int ret;

	printf("Initializing sio...\n");
	ret = sio_init();
	if(ret != 0) {
		printf("failed to initialize client\n");
		goto fail;
	}

	for(int i=0; i<5; i++) {
		SocketSession *session;
		printf("Connecting to socket on localhost...\n");
		ret = sio_connect("localhost:8080", &session);
		if(ret != 0) {
			printf("failed to connect to localhost: %d\n", ret);
			goto fail;
		}
	}

fail:
	pthread_exit(NULL);
	return ret;
}
